package colbert.content.testSort;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Comparator;

public class Test {
    public static void main(String[] args) {
        Student[] students = new Student[5];
        students[0] = new Student("张三", "男", 18, 1.75);
        students[1] = new Student("李四", "男", 19, 1.80);
        students[2] = new Student("王五", "男", 20, 1.70);
        students[3] = new Student("赵六", "男", 21, 1.65);
        students[4] = new Student("刘亦菲", "女", 22, 1.60);

        Arrays.sort(students, Student::compareByAge);

        for (Student student : students) {
            System.out.println(student);
        }
    }
}
